import request from '@/config/axios'

// 班级 VO
export interface ClassinfoVO {
  id: number // 编号
  majorId: number // 专业
  classinfoName: string // 班级名称
}

// 班级 API
export const ClassinfoApi = {
  // 查询班级分页
  getClassinfoPage: async (params: any) => {
    return await request.get({ url: `/td/classinfo/page`, params })
  },

  // 查询班级详情
  getClassinfo: async (id: number) => {
    return await request.get({ url: `/td/classinfo/get?id=` + id })
  },

  // 新增班级
  createClassinfo: async (data: ClassinfoVO) => {
    return await request.post({ url: `/td/classinfo/create`, data })
  },

  // 修改班级
  updateClassinfo: async (data: ClassinfoVO) => {
    return await request.put({ url: `/td/classinfo/update`, data })
  },

  // 删除班级
  deleteClassinfo: async (id: number) => {
    return await request.delete({ url: `/td/classinfo/delete?id=` + id })
  },

  // 导出班级 Excel
  exportClassinfo: async (params) => {
    return await request.download({ url: `/td/classinfo/export-excel`, params })
  },
    getMajorAndSchoolNameRespVoPage:async (params: any)=>{
    return await request.get({ url: `/td/classinfo/getMajorAndSchoolNameRespVoPage`,params})
  },
}
